<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:output method="text"  />
	<xsl:template match="/">/*******************************************************************************
** File Name:		     <xsl:value-of select="@NameSpace" />.cs
** Creator:		       <xsl:value-of select="Schema/@UserName" />
** EMail:            <xsl:value-of select="Schema/@UserEMail" /> 
** Create date:	     <xsl:value-of select="Schema/@ModifyDate" />
** Latest Modifier:
** Latest Modify date:
** Description:		    
** Modify History:
**
** Code Review:
**
** Version number:       1.0.0
*********************************************************************************/
<xsl:value-of select="Schema/@UsingNamespace" />

	/// <summary>
	/// 查看<xsl:value-of select="Schema/@TableName" />
	///	</summary>
	public partial class <xsl:value-of select="Schema/@TableName" />View : <xsl:value-of select="Schema/@BasePageClass" />
    {
    private void Page_Load(object sender, System.EventArgs e)
    {
    LanguageSelect.LanguageChanged += new LanguageChangeHandler(this.LanguageChanged);
    if (!IsPostBack)
    {
    //判断权限
    //if (!CheckRight("FinanceOrderAdmin"))
    //{
    //	NoRightAlert();
    //}
    }

    if (!IsPostBack)
    {
    // 初始化语言下拉框
    LanguageSelect.InitLanguageData();
    // 获取语言参数，并赋给控件。
    string strLanguageID = (string)QueryTable["LanguageID"];
    if (strLanguageID != null <xsl:text disable-output-escaping="yes">&amp;</xsl:text><xsl:text disable-output-escaping="yes">&amp;</xsl:text> strLanguageID != "")
    LanguageSelect.LanguageID = strLanguageID;

    LanguageID = LanguageSelect.LanguageID;

    //加载数据
    int int<xsl:for-each select="Schema/Columns[IsPK='1']"><xsl:value-of select="ColumnName" /></xsl:for-each> = int.Parse((string)QueryTable["<xsl:for-each select="Schema/Columns[IsPK='1']"><xsl:value-of select="ColumnName" /></xsl:for-each>"]);
				ViewState["<xsl:for-each select="Schema/Columns[IsPK='1']"><xsl:value-of select="ColumnName" /></xsl:for-each>"] = int<xsl:for-each select="Schema/Columns[IsPK='1']"><xsl:value-of select="ColumnName" /></xsl:for-each>;

                <xsl:value-of select="Schema/@TableName" /> obj<xsl:value-of select="Schema/@TableName" /> = <xsl:value-of select="Schema/@TableName" />Biz.Get<xsl:value-of select="Schema/@TableName" />(LanguageID,int<xsl:for-each select="Schema/Columns[IsPK='1']"><xsl:value-of select="ColumnName" /></xsl:for-each>);
				<xsl:for-each select="Schema/Columns[IsIdentity='false']">
				lbl<xsl:value-of select="ColumnName"></xsl:value-of>.Text = obj<xsl:value-of select="/Schema/@TableName" />.<xsl:value-of select="ColumnName"></xsl:value-of>.ToString();
				</xsl:for-each>
			}

		}
    
    /// <summary>
    /// 当语言变化时，把语言编号保存在ViewState中
    ///</summary>
    private void LanguageChanged(object sender, System.EventArgs e)
    {
    Response.Redirect("<xsl:value-of select="Schema/@TableName" />Edit.aspx?" + GetEncryptQueryString("LanguageID=" + LanguageSelect.LanguageID + "<xsl:text disable-output-escaping="yes">&amp;</xsl:text><xsl:for-each select="Schema/Columns[IsPK='1']"><xsl:value-of select="ColumnName" /></xsl:for-each>=" + (string)ViewState["<xsl:for-each select="Schema/Columns[IsPK='1']"><xsl:value-of select="ColumnName" /></xsl:for-each>"] ));
    }
	}
	</xsl:template>
</xsl:stylesheet>